﻿using System;
using System.Collections.Generic;
using System.Text;

namespace 建造者模式
{
    public class Computer
    {
        /// <summary>
        /// 电脑类
        /// </summary>
        private IList<string> _parts = new List<string>();

        /// <summary>
        /// 把单个组件添加到电脑组件集合中
        /// </summary>
        /// <param name="part"></param>
        public void Add(string part)
        {
            _parts.Add(part);
        }

        public void Show()
        {
            Console.WriteLine("电脑开始组装。。。。。。。");
            foreach(var part in _parts)
            {
                Console.WriteLine("组件"+part+",已经组装好");
            }
            Console.WriteLine("电脑组装结束。。。。。。。");
        }
    }
}
